package com.digitalchina.lxnsy.activity.farmVideo;

import android.webkit.JavascriptInterface;

import com.digitalchina.lxnsy.activity.old.WebViewActivity;
import com.digitalchina.lxnsy.base.BaseHtmlActivity;
import com.digitalchina.lxnsy.constant.URL;
import com.digitalchina.lxnsy.toolkit.GotoUtil;

import java.util.HashMap;
import java.util.Map;

public class UpdateExpertActivity extends BaseHtmlActivity {
    @Override
    protected void loadHtml() {
        webView.addJavascriptObject(new JsApi(), null);
        loadUrl("update-expert");
        setTitle("升级收费专家");
    }

    @Override
    public void rightOnClick() {

    }

    public class JsApi {
        @JavascriptInterface
        public void toFinish(Object msg) {
            switch (msg.toString()){
                case "0":
                    finish();
                    break;
                case "1":
                    break;
                case "2":
                    Map<String, String> map = new HashMap<>();
                    map.put("url", URL.URL_GET_PROTOCOL_INFO + "?type=3");
                    map.put("title", "文献上传引导说明");
                    GotoUtil.gotoActivity(activity, WebViewActivity.class,"map",map);
                    break;
            }

        }
    }
}
